package com.lanshiqin.webdemo.controller;

import com.lanshiqin.webdemo.service.bug.BrochureFacade;
import com.lanshiqin.webdemo.service.fix.BrochureFacadeFix;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BrochureController {

    @Autowired
    private BrochureFacade brochureFacade;

    @Autowired
    private BrochureFacadeFix brochureFacadeFix;

    @GetMapping("exec")
    public String exec(){
        // 假装用户做了一系列操作，开始异步转换
        brochureFacade.asyncConvertBrochure();
        return "ok";
    }

    @GetMapping("exec2")
    public String exec2(){
        // 改进版本
        brochureFacadeFix.asyncConvertBrochure();
        return "ok";
    }
}
